package many

import (
	"fmt"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
	"gorm.io/gorm/logger"
	"gorm.io/gorm/schema"
	"log"
	"os"
	"time"
)

// 多表查询

func Test() {
	fmt.Println("-----------多表查询---------------------")

	db, err := mysqlConnect()
	if err != nil {
		fmt.Println(err)
		return
	}

	if err := db.AutoMigrate(&DeptCase22{}, &EmpCase22{}, &EmpInfoCase22{}, &BankAccountCase22{}); err != nil {
		fmt.Println("表结构创建失败:", err)
		return
	}

	// 生成数据
	//initdb(db)

	deptArr := []DeptCase22{}
	db.Find(&deptArr)
	for _, dept := range deptArr {
		fmt.Printf("dept: %+v\n", dept)
	}

	fmt.Println("----------------------------------------------")
	empArr := []EmpCase22{}
	db.Find(&empArr)
	for _, emp := range empArr {
		fmt.Printf("emp: %+v\n", emp)
	}

	fmt.Println("----------------------------------------------")
	empInfoArr := []EmpInfoCase22{}
	db.Find(&empInfoArr)
	for _, empInfo := range empInfoArr {
		fmt.Printf("empInfo: %+v\n", empInfo)
	}

	fmt.Println("----------------------------------------------")
	bankArr1 := []BankAccountCase22{}
	db.Find(&bankArr1)
	for _, bank := range bankArr1 {
		fmt.Printf("bank: %+v\n", bank)
	}

	fmt.Println("----------------------------------------------")
	var bankArr2 []BankAccountCase22
	NewSingleQuery(db, &bankArr2).Page(2, 10).Paginate()
	for _, bank := range bankArr2 {
		fmt.Printf("bank: %+v\n", bank)
	}

	fmt.Println("----------------------------------------------")
	//关联查询 员工列表同时展示员工所属部门名称
	query := NewSingleQuery(db, &EmpCase22{}).
		Select("emp_case22.id, emp_case22.emp_name, emp_case22.dept_id,  dept_case22.dept_name").
		LeftJoin("dept_case22 ON emp_case22.dept_id = dept_case22.id")
	res1, err := FindTo[RelEmpDeptCase22](query)
	if err != nil {
		fmt.Println("关联查询错误：", err)
		return
	}
	fmt.Printf("res1: %+v\n", res1)

	fmt.Println("----------------------------------------------")
	//关联查询 "迎宾部"的员工列表 员工列表同时展示员工所属部门名称
	query = NewSingleQuery(db, &EmpCase22{}).
		Select("emp_case22.id, emp_case22.emp_name, emp_case22.dept_id,  dept_case22.dept_name").
		LeftJoin("dept_case22 ON emp_case22.dept_id = dept_case22.id").
		Where("dept_case22.dept_name = ?", "迎宾部")
	res1, err = FindTo[RelEmpDeptCase22](query)
	if err != nil {
		fmt.Println("关联查询错误：", err)
		return
	}
	fmt.Printf("res1: %+v\n", res1)

	fmt.Println("----------------------------------------------")
	//关联分页查询 "迎宾部"的员工列表 员工列表同时展示员工所属部门名称
	query = NewSingleQuery(db, &EmpCase22{}).
		Select("emp_case22.id, emp_case22.emp_name, emp_case22.dept_id,  dept_case22.dept_name").
		LeftJoin("dept_case22 ON emp_case22.dept_id = dept_case22.id").
		Where("dept_case22.dept_name = ?", "迎宾部").
		Page(2, 2)
	res1, pageres, err := PaginateTo[RelEmpDeptCase22](query)
	if err != nil {
		fmt.Println("关联查询错误：", err)
		return
	}
	fmt.Printf("pageres: %+v\n", pageres)
	for _, uuu := range res1 {
		fmt.Printf("res1: %+v\n", uuu)
	}

	fmt.Println("-----------------------------------------------")
	//关联查询 查询部门名称和部门人员数量，并按数量降序
	query = NewSingleQuery(db, &DeptCase22{}).
		Select("dept_case22.dept_name, count(0) as 'num'").
		LeftJoin("emp_case22 ON emp_case22.dept_id = dept_case22.id").
		GroupBy("dept_case22.dept_name").
		OrderByDesc("num")
	res1, err = FindTo[RelEmpDeptCase22](query)
	if err != nil {
		fmt.Println("关联查询错误：", err)
		return
	}
	fmt.Printf("res1: %+v\n", res1)

	fmt.Println("-----------------------------------------------")
	//关联分页查询查询 查询部门名称和部门人员数量，并按数量降序
	query = NewSingleQuery(db, &DeptCase22{}).
		Select("dept_case22.dept_name, count(0) as 'num'").
		LeftJoin("emp_case22 ON emp_case22.dept_id = dept_case22.id").
		GroupBy("dept_case22.dept_name").
		OrderByDesc("num")
	res2, pageres, err := PaginateTo[RelEmpDeptCase22](query)
	if err != nil {
		fmt.Println("关联查询错误：", err)
		return
	}
	fmt.Printf("pageres: %+v\n", pageres)
	fmt.Printf("res1: %+v\n", res2)

	fmt.Println("-----------------------------------------------")
	//查询原生sql 单条查询
	raw1, err := RawFirstTo[RelEmpDeptCase22](db, `SELECT * FROM emp_case22 WHERE id = ?`, 1)
	if err != nil {
		fmt.Printf("查询失败: %v\n", err)
	} else {
		fmt.Printf("raw1: %+v\n", raw1)
	}

	fmt.Println("-----------------------------------------------")
	//查询原生sql 多条查询
	raw2, err := RawFindTo[RelEmpDeptCase22](db, `SELECT * FROM emp_case22 WHERE id > ?`, 1)
	if err != nil {
		fmt.Printf("查询失败: %v\n", err)
	} else {
		fmt.Printf("raw2: %+v\n", raw2)
	}

	fmt.Println("-----------------------------------------------")
	//查询原生sql 分页查询
	raw3, respage, err := RawPaginateTo[RelEmpDeptCase22](db, `SELECT * FROM emp_case22 WHERE id > ?`, 1, 3, 1)
	if err != nil {
		fmt.Printf("查询失败: %v\n", err)
	} else {
		fmt.Println("respage:", respage)
		fmt.Printf("raw3: %+v\n", raw3)
	}

	fmt.Println("-----------------------------------------------")
	//原生SQL泛型方法查询原生sql 动态条件查询
	var sbmaparam map[string]interface{} = map[string]interface{}{
		"empName": "徐福记",
		"deptID":  1,
	}
	sb := NewConditionBuilder(`SELECT * FROM emp_case22 `)
	// 动态增加条件
	if sbmaparam["empName"] != "" {
		sb.AddCondition("emp_name = ?", sbmaparam["empName"], sbmaparam["empName"] != nil)
	}
	if sbmaparam["deptID"] != "" {
		sb.AddCondition("dept_id = ?", sbmaparam["deptID"], sbmaparam["deptID"] != nil)
	}

	sql, args := sb.Build()
	raw33, err := RawFindTo[RelEmpDeptCase22](db, sql, args...)
	if err != nil {
		fmt.Printf("查询失败: %v\n", err)
	} else {
		fmt.Printf("raw33: %+v\n", raw33)
	}
	fmt.Println("-----------------------------------------------")
	//原生SQL泛型方法查询原生sql 动态条件分页查询
	var sbmaparam2 map[string]interface{} = map[string]interface{}{
		"empName": "徐福记",
		"deptID":  1,
	}
	sb2 := NewConditionBuilder(`SELECT * FROM emp_case22  `)
	// 动态增加条件
	if sbmaparam2["deptID"] != nil {
		sb2.AddCondition("dept_id > ?", sbmaparam2["deptID"], sbmaparam2["deptID"] != nil)
	}
	sql2, args := sb2.Build()
	raw333, rpage, err := RawPaginateTo[RelEmpDeptCase22](db, sql2, 2, 3, args...)
	if err != nil {
		fmt.Printf("查询失败: %v\n", err)
	} else {
		fmt.Printf("rpage: %+v\n", rpage)
		fmt.Printf("raw333: %+v\n", raw333)
	}

}

// 初始化连接
func mysqlConnect() (*gorm.DB, error) {
	url := "root:123456@tcp(127.0.0.1:3306)/case1?charset=utf8mb4&parseTime=True&loc=Local"

	// 配置自定义 Logger 打印sql日志
	newLogger := logger.New(
		log.New(os.Stdout, "\r\n", log.LstdFlags), // io writer
		logger.Config{
			SlowThreshold:             time.Second, // 慢 SQL 阈值
			LogLevel:                  logger.Info, // 可以设置为不同级别 Silent-不打印任何日志 Error-只打印错误日志 Warn-打印慢查询和错误 Info-打印慢查询和错误
			IgnoreRecordNotFoundError: true,        // 忽略ErrRecordNotFound（记录未找到）错误
			Colorful:                  true,        // 彩色打印
		},
	)

	db, err := gorm.Open(mysql.Open(url), &gorm.Config{
		Logger: newLogger, // 设置 Logger
		NamingStrategy: schema.NamingStrategy{
			SingularTable: true, // 关闭默认，使用表名
		},
	})
	if err != nil {
		return nil, fmt.Errorf("mysql connect err: %v", err)
	}

	sqlDB, err := db.DB()
	if err != nil {
		panic("failed to get sql.DB")
	}

	// 配置连接池
	// 最大空闲连接数 - 应该小于最大打开连接数
	sqlDB.SetMaxIdleConns(20)
	// 最大打开连接数 - 根据应用负载和MySQL配置调整
	sqlDB.SetMaxOpenConns(100)
	// 连接最大生命周期 - 小于MySQL的wait_timeout设置
	sqlDB.SetConnMaxLifetime(5 * time.Minute)
	// 空闲连接最大存活时间
	sqlDB.SetConnMaxIdleTime(10 * time.Minute)

	return db, nil
}

// 部门，员工，员工信息，员工银行账户
// 部门
type DeptCase22 struct {
	ID       int         `gorm:"primarykey;autoIncrement" json:"id"`
	DeptName string      `gorm:"size:50;not null" json:"dept_name"`
	Emps     []EmpCase22 `gorm:"foreignKey:DeptID" json:"emps"` //一个部门对应多个员工
}

// 员工
type EmpCase22 struct {
	ID           int                 `gorm:"primarykey;autoIncrement" json:"id"`
	EmpName      string              `gorm:"size:50;not null" json:"emp_name"`
	DeptID       int                 `gorm:"index" json:"dept_id"` // 外键字段 建议添加索引
	EmpInfo      EmpInfoCase22       `gorm:"foreignKey:EmpID"`     // 一个员工对应一个 个人信息
	BankAccounts []BankAccountCase22 `gorm:"foreignKey:EmpID"`     //一个员工对应多个银行账户
}

// 员工信息
type EmpInfoCase22 struct {
	ID    int    `gorm:"primarykey;autoIncrement" json:"id"`
	Phone string `gorm:"size:20;not null" json:"phone"`
	Hibby string `gorm:"size:20;not null" json:"hibby"`
	EmpID int    `gorm:"uniqueIndex;"` // 外键且唯一
}

// 员工银行账户
type BankAccountCase22 struct {
	ID       int    `gorm:"primarykey;autoIncrement" json:"id"`
	BankName string `gorm:"size:50;not null;" json:"bank_name"`
	BankCode string `gorm:"size:20;not null;" json:"bank_code"`
	EmpID    int    `gorm:"index;"` // 外键且唯一
}

// 返回查询结果 定义结构体
type RelEmpDeptCase22 struct {
	ID       int    `json:"id"`
	EmpName  string `json:"emp_name"`
	DeptName string `json:"dept_name"`
	DeptID   int    `json:"dept_id"`
	Num      int    `json:"num"`
}

// 初始化数据
func initdb(db *gorm.DB) {

	// 创建部门数据
	dArr1 := []DeptCase22{
		{DeptName: "营销部"},
		{DeptName: "迎宾部"},
		{DeptName: "清洁部"},
		{DeptName: "人事部"},
		{DeptName: "财务部"},
		{DeptName: "纳税部"},
		{DeptName: "产品部"},
		{DeptName: "策划部"},
		{DeptName: "推广部"},
		{DeptName: "库房部"},
	}
	db.Create(&dArr1)

	// 创建员工数据
	eArr1 := []EmpCase22{
		{EmpName: "徐福记", DeptID: 1},
		{EmpName: "徐福", DeptID: 2},
		{EmpName: "旭福", DeptID: 3},
		{EmpName: "旭日", DeptID: 4},
		{EmpName: "旭光", DeptID: 5},
		{EmpName: "旭关", DeptID: 6},
		{EmpName: "旭广", DeptID: 7},
		{EmpName: "徐照", DeptID: 8},
		{EmpName: "徐里", DeptID: 9},
		{EmpName: "徐卡", DeptID: 10},

		{EmpName: "徐萨", DeptID: 1},
		{EmpName: "郭福", DeptID: 2},
		{EmpName: "郭福", DeptID: 3},
		{EmpName: "郭日", DeptID: 4},
		{EmpName: "郭光", DeptID: 5},
		{EmpName: "郭关", DeptID: 6},
		{EmpName: "郭广", DeptID: 7},
		{EmpName: "郭照", DeptID: 8},
		{EmpName: "郭里", DeptID: 9},
		{EmpName: "郭卡", DeptID: 10},

		{EmpName: "李福", DeptID: 1},
		{EmpName: "李福", DeptID: 2},
		{EmpName: "李日", DeptID: 3},
		{EmpName: "李光", DeptID: 4},
		{EmpName: "李关", DeptID: 5},
		{EmpName: "李广", DeptID: 6},
		{EmpName: "李照", DeptID: 7},
		{EmpName: "李里", DeptID: 8},
		{EmpName: "李卡", DeptID: 9},
		{EmpName: "李凯", DeptID: 10},

		{EmpName: "张福", DeptID: 1},
		{EmpName: "张福", DeptID: 2},
		{EmpName: "张日", DeptID: 3},
		{EmpName: "张光", DeptID: 4},
		{EmpName: "张关", DeptID: 5},
		{EmpName: "张广", DeptID: 6},
		{EmpName: "张照", DeptID: 7},
		{EmpName: "张里", DeptID: 8},
		{EmpName: "张卡", DeptID: 9},
		{EmpName: "张凯", DeptID: 10},
	}
	db.Create(&eArr1)

	// 创建员工信息数据
	eiArr1 := []EmpInfoCase22{
		{Phone: "13526032610", Hibby: "java", EmpID: 1},
		{Phone: "13526032611", Hibby: "python", EmpID: 2},
		{Phone: "13526032612", Hibby: "golang", EmpID: 3},
		{Phone: "13526032613", Hibby: "c++", EmpID: 4},
		{Phone: "13526032614", Hibby: "vue", EmpID: 5},
		{Phone: "13526032615", Hibby: "javascript", EmpID: 6},
		{Phone: "13526032616", Hibby: "springboot", EmpID: 7},
		{Phone: "13526032617", Hibby: "spring", EmpID: 8},
		{Phone: "13526032618", Hibby: "mybatis", EmpID: 9},
		{Phone: "13526032619", Hibby: "mybatisPlus", EmpID: 10},

		{Phone: "13526032620", Hibby: "java", EmpID: 11},
		{Phone: "13526032621", Hibby: "python", EmpID: 12},
		{Phone: "13526032622", Hibby: "golang", EmpID: 13},
		{Phone: "13526032623", Hibby: "c++", EmpID: 14},
		{Phone: "13526032624", Hibby: "vue", EmpID: 15},
		{Phone: "13526032625", Hibby: "javascript", EmpID: 16},
		{Phone: "13526032626", Hibby: "springboot", EmpID: 17},
		{Phone: "13526032627", Hibby: "spring", EmpID: 18},
		{Phone: "13526032628", Hibby: "mybatis", EmpID: 19},
		{Phone: "13526032629", Hibby: "mybatisPlus", EmpID: 20},

		{Phone: "13526032630", Hibby: "java", EmpID: 21},
		{Phone: "13526032631", Hibby: "python", EmpID: 22},
		{Phone: "13526032632", Hibby: "golang", EmpID: 23},
		{Phone: "13526032633", Hibby: "c++", EmpID: 24},
		{Phone: "13526032634", Hibby: "vue", EmpID: 25},
		{Phone: "13526032635", Hibby: "javascript", EmpID: 26},
		{Phone: "13526032636", Hibby: "springboot", EmpID: 27},
		{Phone: "13526032637", Hibby: "spring", EmpID: 28},
		{Phone: "13526032638", Hibby: "mybatis", EmpID: 29},
		{Phone: "13526032639", Hibby: "mybatisPlus", EmpID: 30},

		{Phone: "13526032640", Hibby: "java", EmpID: 31},
		{Phone: "13526032641", Hibby: "python", EmpID: 32},
		{Phone: "13526032642", Hibby: "golang", EmpID: 33},
		{Phone: "13526032643", Hibby: "c++", EmpID: 34},
		{Phone: "13526032644", Hibby: "vue", EmpID: 35},
		{Phone: "13526032645", Hibby: "javascript", EmpID: 36},
		{Phone: "13526032646", Hibby: "springboot", EmpID: 37},
		{Phone: "13526032647", Hibby: "spring", EmpID: 38},
		{Phone: "13526032648", Hibby: "mybatis", EmpID: 39},
		{Phone: "13526032649", Hibby: "mybatisPlus", EmpID: 40},
	}
	db.Create(&eiArr1)

	// 创建银行账户数据
	bArr1 := []BankAccountCase22{
		{BankName: "招商", BankCode: "4000111000010", EmpID: 1},
		{BankName: "建设", BankCode: "3000111000010", EmpID: 1},
		{BankName: "工商", BankCode: "2000111000010", EmpID: 1},
		{BankName: "邮政", BankCode: "6000111000010", EmpID: 1},

		{BankName: "招商", BankCode: "4000111000011", EmpID: 2},
		{BankName: "建设", BankCode: "3000111000011", EmpID: 2},
		{BankName: "工商", BankCode: "2000111000011", EmpID: 2},
		{BankName: "邮政", BankCode: "6000111000011", EmpID: 2},

		{BankName: "招商", BankCode: "4000111000012", EmpID: 3},
		{BankName: "建设", BankCode: "3000111000012", EmpID: 3},
		{BankName: "工商", BankCode: "2000111000012", EmpID: 3},
		{BankName: "邮政", BankCode: "6000111000012", EmpID: 3},

		{BankName: "招商", BankCode: "4000111000013", EmpID: 4},
		{BankName: "建设", BankCode: "3000111000013", EmpID: 4},
		{BankName: "工商", BankCode: "2000111000013", EmpID: 4},
		{BankName: "邮政", BankCode: "6000111000013", EmpID: 4},

		{BankName: "招商", BankCode: "4000111000014", EmpID: 5},
		{BankName: "建设", BankCode: "3000111000014", EmpID: 5},
		{BankName: "工商", BankCode: "2000111000014", EmpID: 5},
		{BankName: "邮政", BankCode: "6000111000014", EmpID: 5},

		{BankName: "招商", BankCode: "4000111000015", EmpID: 6},
		{BankName: "建设", BankCode: "3000111000015", EmpID: 6},
		{BankName: "工商", BankCode: "2000111000015", EmpID: 6},
		{BankName: "邮政", BankCode: "6000111000015", EmpID: 6},

		{BankName: "招商", BankCode: "4000111000016", EmpID: 7},
		{BankName: "建设", BankCode: "3000111000016", EmpID: 7},
		{BankName: "工商", BankCode: "2000111000016", EmpID: 7},
		{BankName: "邮政", BankCode: "6000111000016", EmpID: 7},

		{BankName: "招商", BankCode: "4000111000017", EmpID: 8},
		{BankName: "建设", BankCode: "3000111000017", EmpID: 8},
		{BankName: "工商", BankCode: "2000111000017", EmpID: 8},
		{BankName: "邮政", BankCode: "6000111000017", EmpID: 8},

		{BankName: "招商", BankCode: "4000111000018", EmpID: 9},
		{BankName: "建设", BankCode: "3000111000018", EmpID: 9},
		{BankName: "工商", BankCode: "2000111000018", EmpID: 9},
		{BankName: "邮政", BankCode: "6000111000018", EmpID: 9},

		{BankName: "招商", BankCode: "4000111000019", EmpID: 10},
		{BankName: "建设", BankCode: "3000111000019", EmpID: 10},
		{BankName: "工商", BankCode: "2000111000019", EmpID: 10},
		{BankName: "邮政", BankCode: "6000111000019", EmpID: 10},

		{BankName: "招商", BankCode: "4000111000020", EmpID: 11},
		{BankName: "建设", BankCode: "3000111000020", EmpID: 11},
		{BankName: "工商", BankCode: "2000111000020", EmpID: 11},
		{BankName: "邮政", BankCode: "6000111000020", EmpID: 11},

		{BankName: "招商", BankCode: "4000111000021", EmpID: 12},
		{BankName: "建设", BankCode: "3000111000021", EmpID: 12},
		{BankName: "工商", BankCode: "2000111000021", EmpID: 12},
		{BankName: "邮政", BankCode: "6000111000021", EmpID: 12},

		{BankName: "招商", BankCode: "4000111000022", EmpID: 13},
		{BankName: "建设", BankCode: "3000111000022", EmpID: 13},
		{BankName: "工商", BankCode: "2000111000022", EmpID: 13},
		{BankName: "邮政", BankCode: "6000111000022", EmpID: 13},

		{BankName: "招商", BankCode: "4000111000023", EmpID: 14},
		{BankName: "建设", BankCode: "3000111000023", EmpID: 14},
		{BankName: "工商", BankCode: "2000111000023", EmpID: 14},
		{BankName: "邮政", BankCode: "6000111000023", EmpID: 14},

		{BankName: "招商", BankCode: "4000111000024", EmpID: 15},
		{BankName: "建设", BankCode: "3000111000024", EmpID: 15},
		{BankName: "工商", BankCode: "2000111000024", EmpID: 15},
		{BankName: "邮政", BankCode: "6000111000024", EmpID: 15},

		{BankName: "招商", BankCode: "4000111000025", EmpID: 16},
		{BankName: "建设", BankCode: "3000111000025", EmpID: 16},
		{BankName: "工商", BankCode: "2000111000025", EmpID: 16},
		{BankName: "邮政", BankCode: "6000111000025", EmpID: 16},

		{BankName: "招商", BankCode: "4000111000026", EmpID: 17},
		{BankName: "建设", BankCode: "3000111000026", EmpID: 17},
		{BankName: "工商", BankCode: "2000111000026", EmpID: 17},
		{BankName: "邮政", BankCode: "6000111000026", EmpID: 17},

		{BankName: "招商", BankCode: "4000111000027", EmpID: 18},
		{BankName: "建设", BankCode: "3000111000027", EmpID: 18},
		{BankName: "工商", BankCode: "2000111000027", EmpID: 18},
		{BankName: "邮政", BankCode: "6000111000027", EmpID: 18},

		{BankName: "招商", BankCode: "4000111000028", EmpID: 19},
		{BankName: "建设", BankCode: "3000111000028", EmpID: 19},
		{BankName: "工商", BankCode: "2000111000028", EmpID: 19},
		{BankName: "邮政", BankCode: "6000111000028", EmpID: 19},

		{BankName: "招商", BankCode: "4000111000029", EmpID: 20},
		{BankName: "建设", BankCode: "3000111000029", EmpID: 20},
		{BankName: "工商", BankCode: "2000111000029", EmpID: 20},
		{BankName: "邮政", BankCode: "6000111000029", EmpID: 20},

		{BankName: "招商", BankCode: "4000111000030", EmpID: 21},
		{BankName: "建设", BankCode: "3000111000030", EmpID: 21},
		{BankName: "工商", BankCode: "2000111000030", EmpID: 21},
		{BankName: "邮政", BankCode: "6000111000030", EmpID: 21},

		{BankName: "招商", BankCode: "4000111000031", EmpID: 22},
		{BankName: "建设", BankCode: "3000111000031", EmpID: 22},
		{BankName: "工商", BankCode: "2000111000031", EmpID: 22},
		{BankName: "邮政", BankCode: "6000111000031", EmpID: 22},

		{BankName: "招商", BankCode: "4000111000032", EmpID: 23},
		{BankName: "建设", BankCode: "3000111000032", EmpID: 23},
		{BankName: "工商", BankCode: "2000111000032", EmpID: 23},
		{BankName: "邮政", BankCode: "6000111000032", EmpID: 23},

		{BankName: "招商", BankCode: "4000111000033", EmpID: 24},
		{BankName: "建设", BankCode: "3000111000033", EmpID: 24},
		{BankName: "工商", BankCode: "2000111000033", EmpID: 24},
		{BankName: "邮政", BankCode: "6000111000033", EmpID: 24},

		{BankName: "招商", BankCode: "4000111000034", EmpID: 25},
		{BankName: "建设", BankCode: "3000111000034", EmpID: 25},
		{BankName: "工商", BankCode: "2000111000034", EmpID: 25},
		{BankName: "邮政", BankCode: "6000111000034", EmpID: 25},

		{BankName: "招商", BankCode: "4000111000035", EmpID: 26},
		{BankName: "建设", BankCode: "3000111000035", EmpID: 26},
		{BankName: "工商", BankCode: "2000111000035", EmpID: 26},
		{BankName: "邮政", BankCode: "6000111000035", EmpID: 26},

		{BankName: "招商", BankCode: "4000111000036", EmpID: 27},
		{BankName: "建设", BankCode: "3000111000036", EmpID: 27},
		{BankName: "工商", BankCode: "2000111000036", EmpID: 27},
		{BankName: "邮政", BankCode: "6000111000036", EmpID: 27},

		{BankName: "招商", BankCode: "4000111000037", EmpID: 28},
		{BankName: "建设", BankCode: "3000111000037", EmpID: 28},
		{BankName: "工商", BankCode: "2000111000037", EmpID: 28},
		{BankName: "邮政", BankCode: "6000111000037", EmpID: 28},

		{BankName: "招商", BankCode: "4000111000038", EmpID: 29},
		{BankName: "建设", BankCode: "3000111000038", EmpID: 29},
		{BankName: "工商", BankCode: "2000111000038", EmpID: 29},
		{BankName: "邮政", BankCode: "6000111000038", EmpID: 29},

		{BankName: "招商", BankCode: "4000111000039", EmpID: 30},
		{BankName: "建设", BankCode: "3000111000039", EmpID: 30},
		{BankName: "工商", BankCode: "2000111000039", EmpID: 30},
		{BankName: "邮政", BankCode: "6000111000039", EmpID: 30},

		{BankName: "招商", BankCode: "4000111000040", EmpID: 31},
		{BankName: "建设", BankCode: "3000111000040", EmpID: 31},
		{BankName: "工商", BankCode: "2000111000040", EmpID: 31},
		{BankName: "邮政", BankCode: "6000111000040", EmpID: 31},

		{BankName: "招商", BankCode: "4000111000041", EmpID: 32},
		{BankName: "建设", BankCode: "3000111000041", EmpID: 32},
		{BankName: "工商", BankCode: "2000111000041", EmpID: 32},
		{BankName: "邮政", BankCode: "6000111000041", EmpID: 32},

		{BankName: "招商", BankCode: "4000111000042", EmpID: 33},
		{BankName: "建设", BankCode: "3000111000042", EmpID: 33},
		{BankName: "工商", BankCode: "2000111000042", EmpID: 33},
		{BankName: "邮政", BankCode: "6000111000042", EmpID: 33},

		{BankName: "招商", BankCode: "4000111000043", EmpID: 34},
		{BankName: "建设", BankCode: "3000111000043", EmpID: 34},
		{BankName: "工商", BankCode: "2000111000043", EmpID: 34},
		{BankName: "邮政", BankCode: "6000111000043", EmpID: 34},

		{BankName: "招商", BankCode: "4000111000044", EmpID: 35},
		{BankName: "建设", BankCode: "3000111000044", EmpID: 35},
		{BankName: "工商", BankCode: "2000111000044", EmpID: 35},
		{BankName: "邮政", BankCode: "6000111000044", EmpID: 35},

		{BankName: "招商", BankCode: "4000111000045", EmpID: 36},
		{BankName: "建设", BankCode: "3000111000045", EmpID: 36},
		{BankName: "工商", BankCode: "2000111000045", EmpID: 36},
		{BankName: "邮政", BankCode: "6000111000045", EmpID: 36},

		{BankName: "招商", BankCode: "4000111000046", EmpID: 37},
		{BankName: "建设", BankCode: "3000111000046", EmpID: 37},
		{BankName: "工商", BankCode: "2000111000046", EmpID: 37},
		{BankName: "邮政", BankCode: "6000111000046", EmpID: 37},

		{BankName: "招商", BankCode: "4000111000047", EmpID: 38},
		{BankName: "建设", BankCode: "3000111000047", EmpID: 38},
		{BankName: "工商", BankCode: "2000111000047", EmpID: 38},
		{BankName: "邮政", BankCode: "6000111000047", EmpID: 38},

		{BankName: "招商", BankCode: "4000111000048", EmpID: 39},
		{BankName: "建设", BankCode: "3000111000048", EmpID: 39},
		{BankName: "工商", BankCode: "2000111000048", EmpID: 39},
		{BankName: "邮政", BankCode: "6000111000048", EmpID: 39},

		{BankName: "招商", BankCode: "4000111000049", EmpID: 40},
		{BankName: "建设", BankCode: "3000111000049", EmpID: 40},
		{BankName: "工商", BankCode: "2000111000049", EmpID: 40},
		{BankName: "邮政", BankCode: "6000111000049", EmpID: 40},
	}
	db.Create(&bArr1)
}
